﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Vortex.SceneFramework {

	/// <summary>
	/// Defines exceptional situation for resource reference resolving
	/// </summary>
	public class ResourceReferenceResolveException : Exception {
		
		/// <summary>
		/// Gets the resource ID.
		/// </summary>
		/// <value>The resource ID.</value>
		public string ResourceID { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceReferenceResolveException"/> class.
		/// </summary>
		/// <param name="message">The exception message.</param>
		/// <param name="resourceId">The resource id.</param>
		public ResourceReferenceResolveException(string message, string resourceId) : base(message + ", Id = " + resourceId) {
			ResourceID = resourceId;
		}
	}

	/// <summary>
	/// Defines exceptional situation for element reference resolving
	/// </summary>
	public class ElementReferenceResolveException : Exception {

		/// <summary>
		/// Gets or sets the element ID.
		/// </summary>
		/// <value>The element ID.</value>
		public string ElementID { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="ElementReferenceResolveException"/> class.
		/// </summary>
		/// <param name="message">The exception message.</param>
		/// <param name="elementId">The element id.</param>
		public ElementReferenceResolveException(string message, string elementId)
			: base(message + ", Id = " + elementId) {
			ElementID = elementId;
		}
	}

	/// <summary>
	/// Defines exceptional situation for resource reference resolving
	/// </summary>
	public class SceneGraphException : Exception {

		/// <summary>
		/// Initializes a new instance of the <see cref="SceneGraphException"/> class.
		/// </summary>
		/// <param name="message">The message.</param>
		/// <param name="args">The args.</param>
		public SceneGraphException(string message, params object[] args)
			: base(string.Format(message, args)) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="SceneGraphException"/> class.
		/// </summary>
		/// <param name="cause">The cause.</param>
		/// <param name="message">The message.</param>
		/// <param name="args">The args.</param>
		public SceneGraphException(Exception cause, string message, params object[] args)
			: base(string.Format(message, args), cause) {
		}
	}

}
